package com.qqtech.qquan.mall.enums;


public enum MallSupplierTypeDictEnum {
	/**
	 * 供应商类型:1-外部供应商;2-本地供应商
	 */
	EXTERNAL(1, "圈圈直供"),
	LOCAL(2, "本地商家");
    int code;
    String desc;

    MallSupplierTypeDictEnum (int code, String desc) {
        this.code = code;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}
	public String getDesc() {
		return desc;
	}
	
	public static String getDesc(Integer code) {
		if(code!=null){
			for (MallSupplierTypeDictEnum e : MallSupplierTypeDictEnum.values()) {
				if (code.equals(e.getCode())) {
					return e.desc;
				}
			}
		}		
		return "";
	}
    
    public static boolean isInScope(Integer code) {
		if (code == null) {
			return false;
		}
		MallSupplierTypeDictEnum[] arrEnum = MallSupplierTypeDictEnum.values();
		for (MallSupplierTypeDictEnum e : arrEnum) {
			if (e.code == code.intValue()) {
				return true;
			}
		}
		return false;
	}
}

